package common

import (
	"meituan/apps/common/controllers"
	_ "meituan/apps/common/models"

	"github.com/gin-gonic/gin"
)

func IncludeCommonRouter(route *gin.RouterGroup, prefix string) {
	group := route.Group(prefix)
	{
		group.POST("/sms", controllers.Sms)
		banner := group.Group("/banner")
		{
			banner.GET("/", controllers.ListBanner)
			banner.PUT("/", controllers.AddBanner)
			banner.POST("/:id", controllers.UpdateBanner)
			banner.DELETE("/:id", controllers.DeleteBanner)
		}
		category := group.Group("/category")
		{
			category.GET("/", controllers.ListCategory)
			category.PUT("/", controllers.AddCategory)
			category.POST("/:id", controllers.UpdateCategory)
			category.DELETE("/:id", controllers.DeleteCategory)
		}
	}
}
